agora inbox for [email protected]  
help / color / mirror / Atom feed
Partial patch status update, 3/3/13
1932+ messages / 6 participants
[nested] [flat]

* Partial patch status update, 3/3/13
@ 2013-03-03 21:35 Josh Berkus <[email protected]>
  2013-03-04 03:22 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  2013-03-04 03:58 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  0 siblings, 2 replies; 1932+ messages in thread

From: Josh Berkus @ 2013-03-03 21:35 UTC (permalink / raw)
  To: Craig Ringer <[email protected]>; +Cc: pgsql-hackers

Craig,

Here's for your summary.   I stopped at --echo-hidden, working my way up
from the bottom.  Overall, it seems like mostly the patches which are
still in queue are there for good reasons, although there's probably a
few things we could bounce if the authors don't respond in a couple days.

Why isn't this committed already?

- commit_delay advice doc patch
- psql \l to accept patterns

Waiting on Author for more than 2 weeks, should probably be bounced:

- Add code commentary in ProcessInterrupts

Pending Discussion:

- Peter E.'s two pkg-config patches:
-- find libxml2 using pkg-config
-- pkg-config for libpq and ecpg

- Awaiting discussion of whether we support Cygwin anymore:
-- Problematic dependency in plpython Makefile [Cygwin/Windows]

- Awaiting discussion of syntax:
-- PL/PgSQL STRICT
-- Matview WIP Patch

- Awaiting discussion of difficult issues:
-- bugfix: --echo-hidden is not supported by \sf statements

Nobody seems to want to review this:

- transforms

Reminders sent to reviewers:

- Problematic dependency in plpython Makefile [Cygwin/Windows]
- plpgsql_check_function - rebase for 9.3

Reminders set to authors:

- Problematic dependency in plpython Makefile [Cygwin/Windows]
- pg_hba error line reporting
- plpgsql_check_function - rebase for 9.3

-- 
Josh Berkus
PostgreSQL Experts Inc.
http://pgexperts.com


-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
@ 2013-03-04 03:22 ` Craig Ringer <[email protected]>
  2013-03-04 03:37   ` Re: Partial patch status update, 3/3/13 Stephen Frost <[email protected]>
  1 sibling, 1 reply; 1932+ messages in thread

From: Craig Ringer @ 2013-03-04 03:22 UTC (permalink / raw)
  To: Josh Berkus <[email protected]>; +Cc: pgsql-hackers

On 03/04/2013 05:35 AM, Josh Berkus wrote:
> Craig,
>
> Here's for your summary.   I stopped at --echo-hidden, working my way up
> from the bottom.  Overall, it seems like mostly the patches which are
> still in queue are there for good reasons, although there's probably a
> few things we could bounce if the authors don't respond in a couple days.
Thankyou.

I wonder if we need to be more willing to bounce patches that've petered
out and just re-open them if activity resumes.
> Waiting on Author for more than 2 weeks, should probably be bounced:
>
> - Add code commentary in ProcessInterrupts
Done.
> - Awaiting discussion of whether we support Cygwin anymore:
> -- Problematic dependency in plpython Makefile [Cygwin/Windows]
Per earlier discussion we do support cygwin for as long as it doesn't
create an undue maintenance burden for platforms that matter more and so
long as someone cares to maintain it. Looks like it should get committed.
> - Awaiting discussion of syntax:
> -- PL/PgSQL STRICT
> -- Matview WIP Patch
If they're still in general discussion of syntax issues, that seems like
a sign they're possibly not ready for 9.3 ... but in the end, it's up to
the people involved to determine that, certainly not I.
> - Awaiting discussion of difficult issues:
> -- bugfix: --echo-hidden is not supported by \sf statements
Small and difficult -> punt it, IMO.

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
  2013-03-04 03:22 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
@ 2013-03-04 03:37   ` Stephen Frost <[email protected]>
  2013-03-04 03:51     ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  0 siblings, 1 reply; 1932+ messages in thread

From: Stephen Frost @ 2013-03-04 03:37 UTC (permalink / raw)
  To: Craig Ringer <[email protected]>; +Cc: Josh Berkus <[email protected]>; pgsql-hackers

* Craig Ringer ([email protected]) wrote:
> > - Awaiting discussion of syntax:
> > -- PL/PgSQL STRICT

I agree w/ Josh and Craig that this should probably be bounced- mainly
because we need to get 9.3 properly underway and this looks to continue
to be an area of much discussion.

> > -- Matview WIP Patch

This appears to be OBE. :)

> > - Awaiting discussion of difficult issues:
> > -- bugfix: --echo-hidden is not supported by \sf statements
> Small and difficult -> punt it, IMO.

I'd really love to have this properly fixed in 9.3, but I've not been
able to find time to spend on it myself, unfortunately.  I continue to
think that we should build on what we've already got in psql wrt
function handling, but others have differing opinions, apparently.

	Thanks,

		Stephen


Attachments:

  [application/pgp-signature] signature.asc (198B, ../../[email protected]/2-signature.asc)
  download

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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
  2013-03-04 03:22 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  2013-03-04 03:37   ` Re: Partial patch status update, 3/3/13 Stephen Frost <[email protected]>
@ 2013-03-04 03:51     ` Craig Ringer <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Craig Ringer @ 2013-03-04 03:51 UTC (permalink / raw)
  To: Stephen Frost <[email protected]>; +Cc: Josh Berkus <[email protected]>; pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 03/04/2013 11:37 AM, Stephen Frost wrote:
>>> - Awaiting discussion of difficult issues:
>>> -- bugfix: --echo-hidden is not supported by \sf statements
>> Small and difficult -> punt it, IMO.
>
> I'd really love to have this properly fixed in 9.3, but I've not been
> able to find time to spend on it myself, unfortunately. I continue to
> think that we should build on what we've already got in psql wrt
> function handling, but others have differing opinions, apparently.
I have no strong opinion personally, I'm just interested in unblocking
the process a bit at this point.

- -- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.13 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJRNBoyAAoJELBXNkqjr+S2LDMH/0/gIYKd/g8PSbntmO9B71rx
JW/DpyRHp8vB+Hyq0msy5m2KAnHI6rkLDjTQT4laGtLPxo+SwE0tBOeSL41KjNMz
UKlL43/4CsTYJDyQZ1LkewlV2cS6JMikvIxGApVRNMLN1j4tOYr3ytGv6eNPu84o
yl7UqsNArokcvnhFD7Tjz7OyrUNOUhf8chCCIPt3Opbwdp1PxNLBWkDodDkRTiXs
OUGMjN77h/ZPpQImXea9+Hn1bH/UHd3Ya6KEDGw7SHj4IR8gPJJ3OOEwq71GYmxr
37ZVrX3GtmbkeCODVXOPVALXUd6QhivZegamtFBUE8yby71H1PWVtChADay+Cvo=
=hZr0
-----END PGP SIGNATURE-----



-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
@ 2013-03-04 03:58 ` Craig Ringer <[email protected]>
  2013-03-04 05:02   ` Re: Partial patch status update, 3/3/13 Kohei KaiGai <[email protected]>
  2013-03-04 15:33   ` Re: Partial patch status update, 3/3/13 Amit Kapila <[email protected]>
  1 sibling, 2 replies; 1932+ messages in thread

From: Craig Ringer @ 2013-03-04 03:58 UTC (permalink / raw)
  To: Josh Berkus <[email protected]>; +Cc: pgsql-hackers

I've gone through all the Server Features entries and partway through the performance category. So far:

"Writable Foreign Tables" is waiting for Tom to have a chance to check it out and do some detailed work on it. Anyone else who wants to step in and help might be able to improve its chances, as right now it looks like it'll probably slip.

Stalled waiting for final committer check and apply:

- Identity projection (partitioning)
- Writable foreign tables
  (but needs significant work not just apply, test, commit)

Nobody seems to want to review this:

- The SEPostgreSQL patches

I still need to test this on Windows:

- parallel pg_dump

Discussion ongoing, uncertain if it'll make the 9.3 cut:

- Timeout framework extension and lock_timeout
- the rest of the event triggers patch
- checksums

Rejected per thread discussion:

- Add code commentary in ProcessInterrupts

RWF per thread discussion:

- Store additional information in GIN index


Pending update after response to reminders/queries:

- Extension templates
- Adjacent in SP-GiST for range-types
- Performance Improvement by reducing WAL for Update Operation

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
  2013-03-04 03:58 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
@ 2013-03-04 05:02   ` Kohei KaiGai <[email protected]>
  2013-03-04 06:14     ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  1 sibling, 1 reply; 1932+ messages in thread

From: Kohei KaiGai @ 2013-03-04 05:02 UTC (permalink / raw)
  To: Craig Ringer <[email protected]>; +Cc: Josh Berkus <[email protected]>; pgsql-hackers

2013/3/4 Craig Ringer <[email protected]>:
> - The SEPostgreSQL patches
>
> I still need to test this on Windows:
>
SEPostgreSQL is designed to perform on Linux with SELinux
(security-enhanced Linux) feature enabled, because its design
target is centralization of access control rules between DBMS
and operating system.
Unless Windows support SELinux compatible feature in (far)
future, it does not make sense to run SE-PostgreSQL on windows.

Thanks,
-- 
KaiGai Kohei <[email protected]>


-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
  2013-03-04 03:58 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
  2013-03-04 05:02   ` Re: Partial patch status update, 3/3/13 Kohei KaiGai <[email protected]>
@ 2013-03-04 06:14     ` Craig Ringer <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Craig Ringer @ 2013-03-04 06:14 UTC (permalink / raw)
  To: Kohei KaiGai <[email protected]>; +Cc: Josh Berkus <[email protected]>; pgsql-hackers

On 03/04/2013 01:02 PM, Kohei KaiGai wrote:
> 2013/3/4 Craig Ringer <[email protected]>:
>> - The SEPostgreSQL patches
>>
>> I still need to test this on Windows:
>>
> SEPostgreSQL is designed to perform on Linux with SELinux
> (security-enhanced Linux) feature enabled, because its design
> target is centralization of access control rules between DBMS
> and operating system.
> Unless Windows support SELinux compatible feature in (far)
> future, it does not make sense to run SE-PostgreSQL on windows.
Heh, yeah. Thankfully you just misread this; the colon indicates that
this statement applies to the following line (parallel pg_dump).

-- 
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services



-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

* Re: Partial patch status update, 3/3/13
  2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
  2013-03-04 03:58 ` Re: Partial patch status update, 3/3/13 Craig Ringer <[email protected]>
@ 2013-03-04 15:33   ` Amit Kapila <[email protected]>
  1 sibling, 0 replies; 1932+ messages in thread

From: Amit Kapila @ 2013-03-04 15:33 UTC (permalink / raw)
  To: 'Craig Ringer' <[email protected]>; 'Josh Berkus' <[email protected]>; +Cc: pgsql-hackers

For the patch: Patch to compute Max LSN of Data Pages

Reviewer has already given his opinion in mail at below link, that this is good from his side and he has no more further concerns. He has one minor suggestion which I also fixed in later provided patch.
http://www.postgresql.org/message-id/[email protected]....

Can you recommend what should be the way for this patch.


With Regards,
Amit Kapila.



-- 
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

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

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

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

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


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



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

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v52 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--gp2pyozrd5pweboh
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v52-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread

* [PATCH v51 05/10] invert meaning of index_create flag bit
@ 2026-04-03 19:08 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 1932+ messages in thread

From: Álvaro Herrera @ 2026-04-03 19:08 UTC (permalink / raw)

---
 src/backend/catalog/index.c      | 20 +++++++++++---------
 src/backend/catalog/toasting.c   |  2 +-
 src/backend/commands/indexcmds.c |  1 -
 src/include/catalog/index.h      |  2 +-
 4 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index 4b8ed2c7660..5a7c9d81917 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -715,9 +715,9 @@ UpdateIndexRelation(Oid indexoid,
  *			already exists.
  *		INDEX_CREATE_PARTITIONED:
  *			create a partitioned index (table must be partitioned)
- *		INDEX_CREATE_REPORT_PROGRESS:
- *			update the backend's progress information during index build.
-
+ *		INDEX_CREATE_SUPPRESS_PROGRESS:
+ *			don't report progress during the index build.
+ *
  * constr_flags: flags passed to index_constraint_create
  *		(only if INDEX_CREATE_ADD_CONSTRAINT is set)
  * allow_system_table_mods: allow table to be a system catalog
@@ -763,7 +763,7 @@ index_create(Relation heapRelation,
 	bool		invalid = (flags & INDEX_CREATE_INVALID) != 0;
 	bool		concurrent = (flags & INDEX_CREATE_CONCURRENT) != 0;
 	bool		partitioned = (flags & INDEX_CREATE_PARTITIONED) != 0;
-	bool		progress = (flags & INDEX_CREATE_REPORT_PROGRESS) != 0;
+	bool		progress = (flags & INDEX_CREATE_SUPPRESS_PROGRESS) == 0;
 	char		relkind;
 	TransactionId relfrozenxid;
 	MultiXactId relminmxid;
@@ -1454,13 +1454,15 @@ index_create_copy(Relation heapRelation, bool concurrently,
 	}
 
 	/*
-	 * Note: The current callers do not need INDEX_CREATE_REPORT_PROGRESS. If
-	 * 'concurrently' is true, there is no build at all. Otherwise the index
-	 * build is a sub-command of REPACK. The current infrastructure does not
-	 * allow two commands to report their progress at the same time.
+	 * The current callers do not need to report progress: if 'concurrently' is
+	 * true, there is no build at all to report about; and otherwise the index
+	 * build is a sub-command of REPACK, and the current progress reporting
+	 * infrastructure does not allow two commands to report their progress at
+	 * the same time.
 	 */
 	if (concurrently)
-		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT;
+		flags = INDEX_CREATE_SKIP_BUILD | INDEX_CREATE_CONCURRENT |
+			INDEX_CREATE_SUPPRESS_PROGRESS;
 
 	/*
 	 * Now create the new index.
diff --git a/src/backend/catalog/toasting.c b/src/backend/catalog/toasting.c
index 51b27a8c71c..dcee536fd3f 100644
--- a/src/backend/catalog/toasting.c
+++ b/src/backend/catalog/toasting.c
@@ -332,7 +332,7 @@ create_toast_table(Relation rel, Oid toastOid, Oid toastIndexOid,
 				 BTREE_AM_OID,
 				 rel->rd_rel->reltablespace,
 				 collationIds, opclassIds, NULL, coloptions, NULL, (Datum) 0,
-				 INDEX_CREATE_IS_PRIMARY | INDEX_CREATE_REPORT_PROGRESS, 0,
+				 INDEX_CREATE_IS_PRIMARY, 0,
 				 true, true, NULL);
 
 	table_close(toast_rel, NoLock);
diff --git a/src/backend/commands/indexcmds.c b/src/backend/commands/indexcmds.c
index 932924c13e0..cba379810c7 100644
--- a/src/backend/commands/indexcmds.c
+++ b/src/backend/commands/indexcmds.c
@@ -1231,7 +1231,6 @@ DefineIndex(ParseState *pstate,
 		flags |= INDEX_CREATE_PARTITIONED;
 	if (stmt->primary)
 		flags |= INDEX_CREATE_IS_PRIMARY;
-	flags |= INDEX_CREATE_REPORT_PROGRESS;
 
 	/*
 	 * If the table is partitioned, and recursion was declined but partitions
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 7ebe4f0bd87..9f538dac798 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -71,7 +71,7 @@ extern void index_check_primary_key(Relation heapRel,
 #define	INDEX_CREATE_IF_NOT_EXISTS			(1 << 4)
 #define	INDEX_CREATE_PARTITIONED			(1 << 5)
 #define INDEX_CREATE_INVALID				(1 << 6)
-#define INDEX_CREATE_REPORT_PROGRESS		(1 << 7)
+#define INDEX_CREATE_SUPPRESS_PROGRESS		(1 << 7)
 
 extern Oid	index_create(Relation heapRelation,
 						 const char *indexRelationName,
-- 
2.47.3


--r2slln3zpmilwu22
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v51-0006-Error-out-any-process-that-would-block-at-REPACK.patch"



^ permalink  raw  reply  [nested|flat] 1932+ messages in thread


end of thread, other threads:[~2026-04-03 19:08 UTC | newest]

Thread overview: 1932+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2013-03-03 21:35 Partial patch status update, 3/3/13 Josh Berkus <[email protected]>
2013-03-04 03:22 ` Craig Ringer <[email protected]>
2013-03-04 03:37   ` Stephen Frost <[email protected]>
2013-03-04 03:51     ` Craig Ringer <[email protected]>
2013-03-04 03:58 ` Craig Ringer <[email protected]>
2013-03-04 05:02   ` Kohei KaiGai <[email protected]>
2013-03-04 06:14     ` Craig Ringer <[email protected]>
2013-03-04 15:33   ` Amit Kapila <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v51 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Álvaro Herrera <[email protected]>
2026-04-03 19:08 [PATCH v52 05/10] invert meaning of index_create flag bit Á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